<template>
  <div class="likeMusic">
     <div class="likeMusicTop">
        <span
          class="iconfont icon-xiazai6"
          @click="$router.go(-1)"
        ></span>
        <span class="icona">喜欢的音乐</span>
      </div>


           <div class="musicList">
        <dd
          v-for="(item, index) in splices"
          :key="item.id"
        >
          <h1>{{ index + 1 }}</h1>
          <div class="info">
            <div class="text">
              <h2>{{ item.name }}</h2>
              <h3>
                <span v-for="value in item.ar" :key="value.id">{{
                  value.name
                }}</span>
              </h3>
            </div>

            <div class="iconfont icon-liebiao-bofang bofang"></div>
          </div>
        </dd>
      </div>



  </div>
</template>

<script>
import {getLikelist,getSongDetail} from "../../api/user";
export default {
  data(){
    return{
      isLikelist:[],//喜欢的音乐
      ail:[],
      splices:[],
    }
  },
  created(){
    let id = JSON.parse(localStorage.getItem("uid"));
     getLikelist({uid:id}).then(data=>{
       console.log(44,data);
      this.isLikelist = data.ids
      console.log(this.isLikelist,44);

      let ids= this.isLikelist.join(",");
      getSongDetail({ids:ids,limit:150}).then(data=>{
      this.ail=data.songs;
      this.splices = this.ail.splice(0,150)
      console.log(this.splices);

    })
    })
  



  },
}
</script>

<style lang="less">
  .likeMusic{

    padding: 15px;
      .musicList {
    background-color: #fff;
    width: 100%;
    border-radius: 7px;
    position: relative;
    top: -7px;

    dt {
      height: 36px;
      line-height: 36px;
      font-size: 16px;
      color: #454747;
      border-bottom: 1px solid #e3e3e3;
      span {
        font-size: 14px;
        color: #797b7a;
      }
      i {
        width: 44px;
        text-align: center;
        display: inline-block;
      }
    }
    dd {
      border-bottom: 1px solid #e3e3e3;
      height: 53px;
      display: flex;
      h1 {
        flex: 0 0 44px;
        line-height: 53px;
        text-align: center;
        font-size: 16px;
        color: #6d6e6e;
      }
      .info {
        flex: 1;
        display: flex;
        justify-content: space-between;
        .text {
          h2 {
            font-size: 16px;
            color: #1b1c1c;
            margin-top: 10px;
          }
          h3 {
            font-size: 12px;
            color: #929393;
          }
        }
        .bofang {
          font-size: 24px;
          line-height: 53px;
          text-align: center;
          padding-right: 10px;
        }
      }
    }
  }
    .likeMusicTop{
      width: 100%;
      height: 32px;
      position: relative;
      font-size: 18px;
      .icona {
        font-size: 18px;
      }
    }
     .vanCell{
    height: 60px;
    padding-top: 26px;
    display: flex;
    h3{
      width: 40px;
      height: 40px;
      line-height: 40px;
      text-align: center;
    }
    .recentImg{
    margin-left: 5px;
    width: 40px;
    height: 40px;
    // background-color: red;
    img{
      width: 100%;
      height: 100%;
    }
  }
  .recentName{
    margin-left: 12px;
    h4{
      width: 200px;
       white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;    
    }
    p{
      font-size: 12px;
      margin-top: 5px;
      color: #696969;
      word-break: break-all;
      overflow: hidden;
      text-overflow: ellipsis;
      display:-webkit-box;
      -webkit-line-clamp: 2;  /*设置行数 */
      -webkit-box-orient: vertical;
    }
  }
  }
  }
</style>